[list(map(lambda y: print(int(y[1])//pow(int(y[0]),2)),map(lambda x: x, [input().strip().split(' ')]))) for _ in range(int(input()))]
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef int ii;
typedef double dd;
typedef char ch;
typedef long double ld;
typedef string st;
typedef map<ll,ll> mall;
typedef vector<ll> vll;
typedef vector<ii> vii;
#define forn(n,i,j) for(ll i=j;i<n;i++)
#define forv(n,i,j,v) for(ll i=j;i<n;i++)cin>>v[i];
#define form(n,i,j) for(ll i=n-1;i>=j;i--)
#define sor(v) sort(v.begin(),v.end())
#define usor(v) sort(v.rbegin(),v.rend())
#define rev(v) reverse(v.begin(),v.end())
#define mp make_pair
#define pb push_back
#define fi first
#define se second
#define TerCo ios::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define W(t) ll t;cin>>t;while(t--)
#define cn(v,n) count(all(v),n)
#define point(n) fixed<<setprecision(n)
#define PI 3.14159265358979323846
int main(){
TerCo;
W(t){
ll n,s;
cin>>n>>s;
ll ans = s/(n*n);
cout<<ans<<"\n";
}
}
1715D - 2+ doors | 267A - Subtractions |
1582A - Luntik and Concerts | 560A - Currency System in Geraldion |
946A - Partition | 1068B - LCM |
1692E - Binary Deque | 679A - Bear and Prime 100 |
488A - Giga Tower | 14A - Letter |
1150A - Stock Arbitraging | 1552A - Subsequence Permutation |
1131F - Asya And Kittens | 1475F - Unusual Matrix |
133B - Unary | 1547A - Shortest Path with Obstacle |
624A - Save Luke | 1238A - Prime Subtraction |
1107C - Brutality | 1391B - Fix You |
988B - Substrings Sort | 312A - Whose sentence is it |
513A - Game | 1711E - XOR Triangle |
688A - Opponents | 20C - Dijkstra |
1627D - Not Adding | 893B - Beautiful Divisors |
864B - Polycarp and Letters | 1088A - Ehab and another construction problem |